#include "algorithm_choose.h"
#include "ui_algorithm_choose.h"
#include <QBitmap>
#include <QPainter>

Algorithm_choose::Algorithm_choose(bool mod,QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Algorithm_choose)
{
    ui->setupUi(this);
    setWindowFlags(Qt::FramelessWindowHint);
    //设置关于窗体为圆角
    QBitmap bmp(this->size());
    bmp.fill();
    QPainter p(&bmp);
    p.setPen(Qt::NoPen);
    p.setBrush(Qt::black);
    p.drawRoundedRect(bmp.rect(),20,20);
    setMask(bmp);
    if (mod)
    {
       ui->Algorithm1->setText("单目算法");
    }
    else
    {
       ui->Algorithm1->setText("BM算法");
    }
}

Algorithm_choose::~Algorithm_choose()
{
    delete ui;
}

void Algorithm_choose::on_Algorithm1_clicked()
{
    this->algorithm = 1;
    this->accept();
}
